﻿using MyConsoleApp1;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var user = textBox1.Text;
            var passWord = textBox2.Text;
            var passWord1 = textBox3.Text;

            if (passWord.Equals(passWord1))
            {
                var sql = string.Format("insert into userRegister(username,userPassword)values('{0}','{1}')",user,passWord);
                var sql1= SQLdbHelper.Operate(sql);
                if (sql1 == 1)
                {
                    MessageBox.Show("添加成功！", "提示");
                }
                else
                {
                    MessageBox.Show("添加失败！", "提示");
                }
                this.Close();
            }

        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }
    }
}
